package com.tencent.sr.iris.activity.restapi.task;


import com.tencent.sr.iris.activity.interfaces.client.task.GroupTaskCoreClient;
import com.tencent.sr.iris.activity.interfaces.request.task.TaskCommissionRequest;
import com.tencent.sr.iris.activity.interfaces.request.task.TaskIncomeRequest;
import com.tencent.sr.iris.activity.interfaces.request.task.TaskRewardListRequest;
import com.tencent.sr.iris.activity.interfaces.response.group.task.TaskCommissionResponse;
import com.tencent.sr.iris.activity.interfaces.response.group.task.TaskIncomeResponse;
import com.tencent.sr.iris.activity.interfaces.response.group.task.TaskRewardListResponse;
import com.tencent.sr.iris.activity.service.task.CommissionGroupTaskService;
import com.tencent.sr.rmall.common.primitive.HttpResult;
import com.tencent.sr.rmall.common.request.PaginationRequest;
import com.tencent.sr.rmall.common.response.PaginationResponse;
import io.swagger.annotations.Api;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@Api("团长任务-分佣相关接口")
@RequestMapping("/api/v1/iris/iris-activity-core-service/commission")
public class GroupTaskCoreController implements GroupTaskCoreClient {

    @Resource
    private CommissionGroupTaskService commissionGroupTaskService;

    @Override
    public HttpResult<TaskCommissionResponse> taskReward(@Validated @RequestBody TaskCommissionRequest request) {
        return HttpResult.succ(commissionGroupTaskService.taskReward(request));
    }

    @Override
    public HttpResult<TaskIncomeResponse> taskRewardNew(TaskIncomeRequest request) {
        return HttpResult.succ(commissionGroupTaskService.taskRewardNew(request));
    }

    @Override
    public HttpResult<PaginationResponse<TaskRewardListResponse>> pageRewardList(
            @Validated @RequestBody PaginationRequest<TaskRewardListRequest> request) {
        return HttpResult.succ(commissionGroupTaskService.pageRewardList(request));
    }

}
